package fr.afcepf.ai85.ent;

// Generated 21 mars 2013 17:20:56 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Encadrant generated by hbm2java
 */
@Entity
@Table(name = "encadrant", catalog = "gepeto_db")
public class Encadrant implements java.io.Serializable {

	private Integer idEncadrant;
	private Ecole ecole;
	private String nomEncadrant;
	private String prenomEncadrant;
	private String fonctionEncadrant;
	private String adresseEncadrant;
	private String telEncadrant;
	private String emailEncadrant;
	private Set<AnneeScolaire> anneeScolaires = new HashSet<AnneeScolaire>(0);
	private Set<PeriodeAbsenceEncadrant> periodeAbsenceEncadrants = new HashSet<PeriodeAbsenceEncadrant>(
			0);
	private Set<DateAbsencePointage> dateAbsencePointages = new HashSet<DateAbsencePointage>(
			0);
	private Set<JoursEncadrement> joursEncadrements = new HashSet<JoursEncadrement>(
			0);

	public Encadrant() {
	}

	public Encadrant(Ecole ecole, String nomEncadrant) {
		this.ecole = ecole;
		this.nomEncadrant = nomEncadrant;
	}

	public Encadrant(Ecole ecole, String nomEncadrant, String prenomEncadrant,
			String fonctionEncadrant, String adresseEncadrant,
			String telEncadrant, String emailEncadrant,
			Set<AnneeScolaire> anneeScolaires,
			Set<PeriodeAbsenceEncadrant> periodeAbsenceEncadrants,
			Set<DateAbsencePointage> dateAbsencePointages,
			Set<JoursEncadrement> joursEncadrements) {
		this.ecole = ecole;
		this.nomEncadrant = nomEncadrant;
		this.prenomEncadrant = prenomEncadrant;
		this.fonctionEncadrant = fonctionEncadrant;
		this.adresseEncadrant = adresseEncadrant;
		this.telEncadrant = telEncadrant;
		this.emailEncadrant = emailEncadrant;
		this.anneeScolaires = anneeScolaires;
		this.periodeAbsenceEncadrants = periodeAbsenceEncadrants;
		this.dateAbsencePointages = dateAbsencePointages;
		this.joursEncadrements = joursEncadrements;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID_ENCADRANT", unique = true, nullable = false)
	public Integer getIdEncadrant() {
		return this.idEncadrant;
	}

	public void setIdEncadrant(Integer idEncadrant) {
		this.idEncadrant = idEncadrant;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "IDENTIFIANT_ECOLE", nullable = false)
	public Ecole getEcole() {
		return this.ecole;
	}

	public void setEcole(Ecole ecole) {
		this.ecole = ecole;
	}

	@Column(name = "NOM_ENCADRANT", nullable = false, length = 50)
	public String getNomEncadrant() {
		return this.nomEncadrant;
	}

	public void setNomEncadrant(String nomEncadrant) {
		this.nomEncadrant = nomEncadrant;
	}

	@Column(name = "PRENOM_ENCADRANT", length = 50)
	public String getPrenomEncadrant() {
		return this.prenomEncadrant;
	}

	public void setPrenomEncadrant(String prenomEncadrant) {
		this.prenomEncadrant = prenomEncadrant;
	}

	@Column(name = "FONCTION_ENCADRANT", length = 25)
	public String getFonctionEncadrant() {
		return this.fonctionEncadrant;
	}

	public void setFonctionEncadrant(String fonctionEncadrant) {
		this.fonctionEncadrant = fonctionEncadrant;
	}

	@Column(name = "ADRESSE_ENCADRANT", length = 50)
	public String getAdresseEncadrant() {
		return this.adresseEncadrant;
	}

	public void setAdresseEncadrant(String adresseEncadrant) {
		this.adresseEncadrant = adresseEncadrant;
	}

	@Column(name = "TEL_ENCADRANT", length = 20)
	public String getTelEncadrant() {
		return this.telEncadrant;
	}

	public void setTelEncadrant(String telEncadrant) {
		this.telEncadrant = telEncadrant;
	}

	@Column(name = "EMAIL_ENCADRANT", length = 25)
	public String getEmailEncadrant() {
		return this.emailEncadrant;
	}

	public void setEmailEncadrant(String emailEncadrant) {
		this.emailEncadrant = emailEncadrant;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "travailler", catalog = "gepeto_db", joinColumns = { @JoinColumn(name = "ID_ENCADRANT", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "ID_ANNEESCOLAIRES", nullable = false, updatable = false) })
	public Set<AnneeScolaire> getAnneeScolaires() {
		return this.anneeScolaires;
	}

	public void setAnneeScolaires(Set<AnneeScolaire> anneeScolaires) {
		this.anneeScolaires = anneeScolaires;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "encadrant")
	public Set<PeriodeAbsenceEncadrant> getPeriodeAbsenceEncadrants() {
		return this.periodeAbsenceEncadrants;
	}

	public void setPeriodeAbsenceEncadrants(
			Set<PeriodeAbsenceEncadrant> periodeAbsenceEncadrants) {
		this.periodeAbsenceEncadrants = periodeAbsenceEncadrants;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "encadrant")
	public Set<DateAbsencePointage> getDateAbsencePointages() {
		return this.dateAbsencePointages;
	}

	public void setDateAbsencePointages(
			Set<DateAbsencePointage> dateAbsencePointages) {
		this.dateAbsencePointages = dateAbsencePointages;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "encadrant")
	public Set<JoursEncadrement> getJoursEncadrements() {
		return this.joursEncadrements;
	}

	public void setJoursEncadrements(Set<JoursEncadrement> joursEncadrements) {
		this.joursEncadrements = joursEncadrements;
	}

}
